# Copyright (c) WanSheng Intelligent Corp. All rights reserved.
# Licensed under the Apache 2.0 license. See LICENSE file in the project root for full license information.

cmake_minimum_required(VERSION 2.8.12)
project(hello_main)
# add_compile_options(-fsanitize=address)
# add_link_options(-fsanitize=address)

if ($ENV{sanitizer} MATCHES yes)
    message("PluginSDK: Debug build, enable sanitizer")
    add_compile_options(-fsanitize=address)
    add_link_options(-fsanitize=address)
endif()

if(NOT DEFINED WA_SDK_DIR)
  set (WA_SDK_DIR  ${CMAKE_CURRENT_LIST_DIR}/../../../out/host/wa-iot)
endif()
include(${WA_SDK_DIR}/wa-sdk.cmake)

set(hello_world_sources
    ./src/main.c
)
if(WIN32)
    set(hello_world_sources 
        ${hello_world_sources}
        ./src/hello_world_win.json
    )
else()
    set(hello_world_sources 
        ${hello_world_sources}
        ./src/hello_world_lin.json
    )
endif()



add_executable(hello_world_sample ${hello_world_sources})
linkWA_SDK(hello_world_sample)


